<? if ($c = stack('name')) {
	
	$da = component_data($c);
	$s = component_settings($c);
	

	if ( sizeof($da['links']) ) { ?>

		<div class="searchresults"><ul><?
		
			foreach($links as $link) {
				?><li><a href="<?=h($link['url'])?>"><?=$link['title']?></a><br />			
					<p>...<?=mb_convert_encoding($link['text_start'], 'HTML-ENTITIES', 'UTF-8')?><strong><?=$link['word']?></strong><?=mb_convert_encoding($link['text_end'], 'HTML-ENTITIES', 'UTF-8')?>...</p>
				</li><?
			}
			
		?></ul></div><? 
		
		 if (sizeof($d = $da['paging']['data'])) { ?><ul class="paging"><?
			  foreach ($d as $v) { ?><li class="<?="$v[first] $v[last]"?>"><?
					if ($v['url']) {
						 ?><a href="<?="$v[url]?q=$link[word]"?>" title="<?=$v['title']?>"><?=$v['title']?></a><?
					} else {
						 if ($v['title']) {
							  ?><strong>[<?=$v['title']?>]</strong><?
						 } else {
							  ?><span>...</span><?
						 }
					}
					?></li><?
			  }
			  ?></ul><?
		 }
	
	} else { 
		?><?=$s['not_found']?><? 
	} 	
}

unstack();